package com.xaicode.learn.netty.dubborpc.customer;

import com.xaicode.learn.netty.dubborpc.interfaces.HelloService;
import com.xaicode.learn.netty.dubborpc.netty.NettyClient;
import lombok.extern.slf4j.Slf4j;

/**
 * @author Locker xaicode@sina.com
 * @version 1.0
 * @date 2021/6/20 0020 22:37
 */
@Slf4j
public class ClientBootstrap {

    // protocol prefix
    public static final String providerPrefix = "HelloService#hello#";

    public static void main(String[] args) {

        NettyClient customer = new NettyClient();

        // create service proxy
        HelloService helloService = (HelloService) customer.getBean(HelloService.class, providerPrefix);

        // call
        String result = helloService.hello("hello dubbo");
        log.info("receive server result: {}", result);
    }

}
